import flyDate from './flydata';
import { FlytrackFun, FlyLineFun } from './fly';
import { Vector3, Group } from 'three';


const flyStart = [flyDate[0].E, flyDate[0].N];
const flyGroup = new Group();
for(let i = 1;i<flyDate.length;i++){
    const flyMesh = FlytrackFun(new Vector3(flyStart[0], flyStart[1], 0), new Vector3(flyDate[i].E, flyDate[i].N, 0));
    const points = flyMesh['flyTrackPoints'];
    const fly = FlyLineFun(points);
    fly['index'] = Math.floor(fly['index']*Math.random());
    flyMesh.add(fly);
    (<any>flyGroup).add(flyMesh);
}
console.log(flyGroup);
export { flyGroup };